using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Mutzl.Samples.VideoApp.Controls
{
    public class VariableGridView : GridView
    {
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            var viewModel = item as IResizable;

            if (viewModel != null)
            {
                element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, viewModel.Width);
                element.SetValue(VariableSizedWrapGrid.RowSpanProperty, viewModel.Height);
            }

            base.PrepareContainerForItemOverride(element, item);
        }

    }
}